/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ericsson.nfc.signing;

//#ifdef MyJSR257
//# import my.javax.microedition.contactless.ndef.NDEFMessage;
//#else
import javax.microedition.contactless.ndef.NDEFMessage;
//#endif

/**
 *
 * @author emarkki
 */
public abstract class SignedMessage {

    private Signature[] recordsSignatures;
    
    SignedMessage(Signature[] recordSignatures) {
        this.recordsSignatures = recordSignatures;
    }
    
    /**
     * Generates the NDEFMessage.
     * @return The NDEFMessage.
     * @see Signature
     */
    public abstract NDEFMessage toNDEFMessage();

    public Signature[] getRecordsSignatures() {
        return recordsSignatures;
    }

    public Signature getRecordsSignature(int recordIndex) {
        if(recordIndex >= recordsSignatures.length) {
            return null;
        }
        return recordsSignatures[recordIndex];
    }
}
